"""
example01 - 获取A班和B班的考试成绩的描述性统计信息，
比较A班和B班哪个班的学习效果更理想

Author: Administrator
Date: 2024/1/22
"""
import random
# import homework04
from utils.stats import average, median, variance, standard_deviation as std

class_a_scores = [random.randrange(50, 101) for _ in range(50)]
class_b_scores = [random.randrange(50, 101) for _ in range(50)]
print('A班考试成绩描述性统计信息')
# print(f'平均分：{homework04.average(class_a_scores)}')
# print(f'中位数：{homework04.median(class_a_scores)}')
print(f'平均分：{average(class_a_scores)}')
print(f'中位数：{median(class_a_scores)}')
print(f'方差：{variance(class_a_scores)}')
print(f'标准差：{std(class_a_scores)}')

print('B班考试成绩描述性统计信息')
# print(f'平均分：{homework04.average(class_b_scores)}')
# print(f'中位数：{homework04.median(class_b_scores)}')
print(f'平均分：{average(class_b_scores)}')
print(f'中位数：{median(class_b_scores)}')
print(f'方差：{variance(class_b_scores)}')
print(f'标准差：{std(class_b_scores)}')
